/**
 * 用户相关接口类型定义
 */

import { BaseApiResponse } from "./interface";



// 用户基本信息
export interface UserBasicInfo {
  id: string;
  username?: string;
  nickname?: string;
  avatar?: string;
  email?: string;
  mobile?: string;
  gender?: number;
  level?: number;
  status?: number;
  lastLoginTime?: Date;
  birthday?: Date;
  createTime?: Date;
  updateTime?: Date;
}

// 更新用户信息响应
export interface UpdateUserResponse extends UserBasicInfo {}

export interface UpdateUserApiResponse extends BaseApiResponse<UpdateUserResponse> {}

// 企业微信二维码信息
export interface WorkWechatQRCodeResponse {
  qrCodeUrl: string;
  state: string;
  expiresIn?: number;
}

export interface WorkWechatQRCodeApiResponse extends BaseApiResponse<WorkWechatQRCodeResponse> {}

// 企业微信绑定响应
export interface WorkWechatBindResponse {
  success: boolean;
  userInfo?: {
    userId: string;
    name?: string;
    avatar?: string;
    department?: string[];
    position?: string;
  };
}

export interface WorkWechatBindApiResponse extends BaseApiResponse<WorkWechatBindResponse> {}

// 企业微信解绑响应
export interface WorkWechatUnbindApiResponse extends BaseApiResponse<string> {}

// 企业微信绑定信息
export interface WorkWechatInfo {
  isBound: boolean;
  userInfo?: {
    userId: string;
    name?: string;
    avatar?: string;
    department?: string[];
    position?: string;
    bindTime?: Date;
  };
}

export interface WorkWechatInfoApiResponse extends BaseApiResponse<WorkWechatInfo> {}

// 同步企业微信用户信息响应
export interface SyncWorkWechatUserResponse {
  success: boolean;
  updatedFields?: string[];
  userInfo?: {
    name?: string;
    avatar?: string;
    department?: string[];
    position?: string;
  };
}

export interface SyncWorkWechatUserApiResponse extends BaseApiResponse<SyncWorkWechatUserResponse> {}

// 用户加速卡信息
export interface UserSpeedCard {
  id: string;
  name: string;
  description?: string;
  speedMultiplier: number;
  quantity: number;
  usedQuantity: number;
  availableQuantity: number;
  obtainTime: Date;
  expiryTime?: Date;
  iconUrl?: string;
  speedCard?: {
    id: string;
    name: string;
    description?: string;
    speedMultiplier: number;
    iconUrl?: string;
  };
}

// 用户加速卡列表响应
export interface UserSpeedCardsApiResponse extends BaseApiResponse<UserSpeedCard[]> {}
